.class public Lcom/netease/newsreader/adapter/CityGroupAdapter;
.super Lcom/netease/newsreader/util/GroupAdapter;
.source "CityGroupAdapter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;,
        Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;,
        Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/netease/newsreader/util/GroupAdapter",
        "<",
        "Ljava/lang/String;",
        "Ljava/util/Map",
        "<",
        "Ljava/lang/String;",
        "Ljava/lang/Object;",
        ">;>;"
    }
.end annotation


# instance fields
.field private mContext:Landroid/content/Context;

.field private mInflater:Landroid/view/LayoutInflater;

.field private mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;)V
    .locals 1
    .parameter "context"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/List",
            "<",
            "Lcom/netease/newsreader/util/Pair",
            "<",
            "Ljava/lang/String;",
            "Ljava/util/List",
            "<",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            ">;>;>;>;)V"
        }
    .end annotation

    .prologue
    .line 29
    .local p2, list:Ljava/util/List;,"Ljava/util/List<Lcom/netease/newsreader/util/Pair<Ljava/lang/String;Ljava/util/List<Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;>;>;>;"
    invoke-direct {p0, p2}, Lcom/netease/newsreader/util/GroupAdapter;-><init>(Ljava/util/List;)V

    .line 30
    iput-object p1, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mContext:Landroid/content/Context;

    .line 31
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mInflater:Landroid/view/LayoutInflater;

    .line 32
    invoke-static {p1}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->getThemeSettingsHelper(Landroid/content/Context;)Lcom/netease/newsreader/util/ThemeSettingsHelper;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    .line 33
    return-void
.end method


# virtual methods
.method public getChildView(IILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 8
    .parameter "groupPosition"
    .parameter "childPosition"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    const v7, 0x7f0c00f6

    const v6, 0x7f080027

    const/16 v5, 0x8

    const/4 v4, 0x0

    .line 38
    if-nez p1, :cond_3

    .line 39
    if-nez p3, :cond_0

    .line 40
    iget-object v2, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mInflater:Landroid/view/LayoutInflater;

    const v3, 0x7f03002e

    invoke-virtual {v2, v3, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p3

    .line 41
    new-instance v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;

    invoke-direct {v0, p0, v4}, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;-><init>(Lcom/netease/newsreader/adapter/CityGroupAdapter;Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;)V

    .line 42
    .local v0, holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;
    invoke-virtual {p3, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;->title:Landroid/widget/TextView;

    .line 43
    const v2, 0x7f0c00c1

    invoke-virtual {p3, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ProgressBar;

    iput-object v2, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;->progress:Landroid/widget/ProgressBar;

    .line 44
    invoke-virtual {p3, v0}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 46
    .end local v0           #holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;
    :cond_0
    invoke-virtual {p3}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;

    .line 47
    .restart local v0       #holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;
    invoke-virtual {p0, p1, p2}, Lcom/netease/newsreader/adapter/CityGroupAdapter;->getChild(II)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Map;

    .line 48
    .local v1, item:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    sget-object v2, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;

    const-string v3, "ipquery"

    invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/Boolean;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 49
    iget-object v2, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;->progress:Landroid/widget/ProgressBar;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/widget/ProgressBar;->setVisibility(I)V

    .line 50
    iget-object v2, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;->title:Landroid/widget/TextView;

    const v3, 0x7f0b00a5

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(I)V

    .line 58
    :goto_0
    iget-object v2, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v3, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mContext:Landroid/content/Context;

    iget-object v4, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;->title:Landroid/widget/TextView;

    invoke-virtual {v2, v3, v4, v6}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    .line 73
    .end local v0           #holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;
    :goto_1
    return-object p3

    .line 51
    .restart local v0       #holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;
    :cond_1
    sget-object v2, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;

    const-string v3, "ipquery_fail"

    invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/Boolean;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 52
    iget-object v2, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;->progress:Landroid/widget/ProgressBar;

    invoke-virtual {v2, v5}, Landroid/widget/ProgressBar;->setVisibility(I)V

    .line 53
    iget-object v2, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;->title:Landroid/widget/TextView;

    const v3, 0x7f0b00a3

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(I)V

    goto :goto_0

    .line 55
    :cond_2
    iget-object v2, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;->progress:Landroid/widget/ProgressBar;

    invoke-virtual {v2, v5}, Landroid/widget/ProgressBar;->setVisibility(I)V

    .line 56
    iget-object v3, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;->title:Landroid/widget/TextView;

    const-string v2, "city"

    invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-virtual {v3, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0

    .line 60
    .end local v0           #holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$IpQueryChildViewHolder;
    .end local v1           #item:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    :cond_3
    if-nez p3, :cond_4

    .line 61
    iget-object v2, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mInflater:Landroid/view/LayoutInflater;

    const v3, 0x7f03003c

    invoke-virtual {v2, v3, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p3

    .line 62
    new-instance v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;

    invoke-direct {v0, p0, v4}, Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;-><init>(Lcom/netease/newsreader/adapter/CityGroupAdapter;Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;)V

    .line 63
    .local v0, holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;
    invoke-virtual {p3, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;->title:Landroid/widget/TextView;

    .line 64
    invoke-virtual {p3, v0}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 67
    .end local v0           #holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;
    :cond_4
    invoke-virtual {p3}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;

    .line 68
    .restart local v0       #holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;
    invoke-virtual {p0, p1, p2}, Lcom/netease/newsreader/adapter/CityGroupAdapter;->getChild(II)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/Map;

    .line 69
    .restart local v1       #item:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;"
    iget-object v3, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;->title:Landroid/widget/TextView;

    const-string v2, "city"

    invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-virtual {v3, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 70
    iget-object v2, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v3, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mContext:Landroid/content/Context;

    iget-object v4, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$ChildViewHolder;->title:Landroid/widget/TextView;

    invoke-virtual {v2, v3, v4, v6}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    goto :goto_1
.end method

.method public getGroupView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5
    .parameter "groupPosition"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    const/4 v3, 0x0

    .line 78
    if-nez p2, :cond_0

    .line 79
    iget-object v1, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mInflater:Landroid/view/LayoutInflater;

    const v2, 0x7f030030

    invoke-virtual {v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    .line 80
    new-instance v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;

    invoke-direct {v0, p0, v3}, Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;-><init>(Lcom/netease/newsreader/adapter/CityGroupAdapter;Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;)V

    .line 81
    .local v0, holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;
    const v1, 0x7f0c00c5

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;->title:Landroid/widget/TextView;

    .line 82
    invoke-virtual {p2, v0}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 84
    .end local v0           #holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;
    :cond_0
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;

    .line 85
    .restart local v0       #holder:Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;
    iget-object v2, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;->title:Landroid/widget/TextView;

    invoke-virtual {p0, p1}, Lcom/netease/newsreader/adapter/CityGroupAdapter;->getGroup(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/CharSequence;

    invoke-virtual {v2, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 86
    iget-object v1, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mThemeSettingsHelper:Lcom/netease/newsreader/util/ThemeSettingsHelper;

    iget-object v2, p0, Lcom/netease/newsreader/adapter/CityGroupAdapter;->mContext:Landroid/content/Context;

    iget-object v3, v0, Lcom/netease/newsreader/adapter/CityGroupAdapter$GroupViewHolder;->title:Landroid/widget/TextView;

    const v4, 0x7f080027

    invoke-virtual {v1, v2, v3, v4}, Lcom/netease/newsreader/util/ThemeSettingsHelper;->setTextViewColor(Landroid/content/Context;Landroid/widget/TextView;I)V

    .line 87
    return-object p2
.end method

.method public getItemViewType(I)I
    .locals 3
    .parameter "position"

    .prologue
    .line 92
    invoke-virtual {p0, p1}, Lcom/netease/newsreader/adapter/CityGroupAdapter;->getRealPosition(I)Lcom/netease/newsreader/util/GroupAdapter$ItemPosition;

    move-result-object v0

    .line 93
    .local v0, item:Lcom/netease/newsreader/util/GroupAdapter$ItemPosition;,"Lcom/netease/newsreader/util/GroupAdapter$ItemPosition;"
    iget v1, v0, Lcom/netease/newsreader/util/GroupAdapter$ItemPosition;->pos:I

    const/4 v2, -0x1

    if-ne v1, v2, :cond_0

    .line 94
    const/4 v1, 0x0

    .line 98
    :goto_0
    return v1

    .line 95
    :cond_0
    iget v1, v0, Lcom/netease/newsreader/util/GroupAdapter$ItemPosition;->group:I

    if-nez v1, :cond_1

    .line 96
    const/4 v1, 0x2

    goto :goto_0

    .line 98
    :cond_1
    const/4 v1, 0x1

    goto :goto_0
.end method

.method public getViewTypeCount()I
    .locals 1

    .prologue
    .line 104
    const/4 v0, 0x3

    return v0
.end method
